from selenium import webdriver
import pytest
from po.Gjz.base import Base
import time,openpyxl
def driver():
    driver=webdriver.Edge()
    driver.maximize_window()
    yield driver
    driver.quit()
def test_a3mall():
    work=openpyxl.load_workbook('gjz.xlsx')
    excel=work['Sheet1']
    base=Base(driver)
    for row in excel.iter_rows(min_row=2,values_only=True):
        action=row[2]
        params={}
        if action=='goto':
            params['url']=row[5]
        elif action in ('click','send_keys','text'):
            params['loc']=[row[3],row[4]]
            print(row[3])
            print(row[4])
            if action=='send_keys':
                params['text']=row[5]
        if action=='sleep':
            params['timeout']=row[5]
        method=getattr(base,str(action))
        method(**params)